/**
 * Created by Chris on 2016/4/3.
 */
$(function () {

  // 淫贱的阻止页面选中效果
  document.onmousedown=function () {
    document.onmousemove=function () {
      window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
    }
  }
  document.onmouseup=function () {
    document.onmousemove = null;
  }


  var $container = $('.portfolio-items');
  setTimeout(function () {
    $container.isotope({
      itemSelector : '.portfolio-items > div',
      animationOptions: {
        duration: 750,
        easing: 'linear',
        queue: true
      }
    });
  },1000)

  project_info();




  $('#resume').fullpage({
        sectionsColor: ['transparent', 'transparent', '#e4e4e4', 'rgba(255, 255, 255, .0)', 'transparent'],

      scrollingSpeed: 700,
      // 是否首尾相接
       //continuousVertical: true,
      normalScrollElementTouchThreshold: 5,
      // 导航条显示
      navigation: true,

      // 内容超出后是否出现滚动条
      scrollOverflow: false,
      // // 左右滑块循环
      loopHorizontal: false,
      // 导航栏设置
      anchors: ['page1','page2', 'page3', 'page4', 'page5', 'page6','page7','page8','page9','page10','page11','page12','page13','page14'],
      menu: '#menu',
      easing: 'easeInOut',

      // 页面渲染后回调
      afterRender: function () {

        // 顶部导航栏自动会拉事件
        if ($('.navbar-toggle').css('display') == 'block') {
          $('.navbar-collapse li').on('click', function () {
            $('.navbar-toggle').trigger('click');
          });
        }


          $('#fp-nav').addClass('hidden-xs');
        // 为了避免标签太多同一时间加载的话在刚载入页面时候产生怪异感，所有动画元素初始都是hidden的
        setTimeout(function () {
          $('.item-1 .corner' ).show();
          $('.resume-hide').show();
        }, 500);
      },

      // 滚动触发后结束前回调
      onLeave: function (index, nextIndex, direction) {

        if(nextIndex==4){

        }

        if(nextIndex==6){
          $('.sky').hide();
        }else {
            $('.item-6 .top').animate({'height': '50%'},400);
            $('.item-6 .foot').animate({'height': '50%'},400);
        }


        switch (index) {
          case 1:
            $('.item-1 .container1').hide();
            break;

          case 2:
              $('.item-2 .container2').hide();
            break;

          case 3:
            $('.item-3 .container3').hide();
            break;

          case 4:
            $('.item-4 .container4').hide();
            break;

            case 5:
                $('.item-5 .container5').hide();
                break;
            case 6:
                $('.item-6 .container6').hide();
                break;
            case 7:
                $('.item-7 .container7').hide();
                break;
            case 8:
                $('.item-8 .container8').hide();
                break;
            case 9:
                $('.item-9 .container9').hide();
                break;
            case 10:
                $('.item-10 .container10').hide();
                break;
            case 11:
                $('.item-11 .container11').hide();
                break;
            case 12:
                $('.item-12 .container12').hide();
                break;
            case 13:
                $('.item-13 .container13').hide();
                break;


        }
      },

      // 滚动结束后回调
      afterLoad: function (anchorLink, index) {
        switch (anchorLink) {
            case 'page1':
                $('.item-1 .container1').show();
                break;
            case 'page2':
                $('.item-2 .container2').show();
                break;
            case 'page3':
                $('.item-3 .container3').show();
                break;
            case 'page4':
                $('.item-4 .container4').show();
                break;

            case 'page5':
                $('.item-5 .container5').show();
                break;

            case 'page6':
                $('.item-6 .container6').show();
                break;
            case 'page7':
                $('.item-7 .container7').show();
                break;

            case 'page8':
                $('.item-8 .container8').show();
                break;
            case 'page9':
                $('.item-9 .container9').show();
                break;

            case 'page10':
                $('.item-10 .container10').show();
                break;
            case 'page11':
                $('.item-11 .container11').show();
                break;
            case 'page12':
                $('.item-12 .container12').show();
                break;
            case 'page13':
                $('.item-13 .container13').show();
                break;
            case 'page14':
                $('.item-14 .container14').show();
                break;

        }
      },
    }
  )


})



